
import freecad.gears.commands
from freecad import app
from freecad import part
import os
app.newDocument()
gear = freecad.gears.commands.CreateInvoluteGear.create()
gear.num_teeth = 20
gear.height = 10
gear.double_helix = True
app.ActiveDocument.recompute()
savepath = os.path.join(os.path.dirname(__file__), "gear.step")
part.export([gear], savepath)